//Design By Do Trung --- Email : trungqn19852003@yahoo.com
//Ngày Design :5/4/2011 5:00:32 PM
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Linq;
using System.Collections.Generic;
    /// <summary>
	/// </summary>
	public class TinTuc_BA
	{
		public TinTuc_BA() {}
#region 'Variables And Properties'
		 private int int_IdTinTuc ;
		 public int IdTinTuc
			{
			 get 	
				{
					 return this.int_IdTinTuc;
				}
			 set 	
				{
					int_IdTinTuc=value;
				}
			}
		 private int int_IdMenu ;
		 public int IdMenu
			{
			 get 	
				{
					 return this.int_IdMenu;
				}
			 set 	
				{
					int_IdMenu=value;
				}
			}
		 private string string_TenDangNhap ;
		 public string TenDangNhap
			{
			 get 	
				{
					 return this.string_TenDangNhap;
				}
			 set 	
				{
					string_TenDangNhap=value;
				}
			}
		 private string string_TieuDe ;
		 public string TieuDe
			{
			 get 	
				{
					 return this.string_TieuDe;
				}
			 set 	
				{
					string_TieuDe=value;
				}
			}
		 private string string_TomTat ;
		 public string TomTat
			{
			 get 	
				{
					 return this.string_TomTat;
				}
			 set 	
				{
					string_TomTat=value;
				}
			}
		 private string string_NoiDung ;
		 public string NoiDung
			{
			 get 	
				{
					 return this.string_NoiDung;
				}
			 set 	
				{
					string_NoiDung=value;
				}
			}
		 private DateTime DateTime_NgayTao ;
		 public DateTime NgayTao
			{
			 get 	
				{
					 return this.DateTime_NgayTao;
				}
			 set 	
				{
					DateTime_NgayTao=value;
				}
			}
		 private DateTime DateTime_NgayDang ;
		 public DateTime NgayDang
			{
			 get 	
				{
					 return this.DateTime_NgayDang;
				}
			 set 	
				{
					DateTime_NgayDang=value;
				}
			}
		 private string string_HinhAnh ;
		 public string HinhAnh
			{
			 get 	
				{
					 return this.string_HinhAnh;
				}
			 set 	
				{
					string_HinhAnh=value;
				}
			}
		 private string string_TuKhoa ;
		 public string TuKhoa
			{
			 get 	
				{
					 return this.string_TuKhoa;
				}
			 set 	
				{
					string_TuKhoa=value;
				}
			}
		 private string string_Tag ;
		 public string Tag
			{
			 get 	
				{
					 return this.string_Tag;
				}
			 set 	
				{
					string_Tag=value;
				}
			}
		 private string string_NguonTin ;
		 public string NguonTin
			{
			 get 	
				{
					 return this.string_NguonTin;
				}
			 set 	
				{
					string_NguonTin=value;
				}
			}
		 private bool bool_TinNoiBat ;
		 public bool TinNoiBat
			{
			 get 	
				{
					 return this.bool_TinNoiBat;
				}
			 set 	
				{
					bool_TinNoiBat=value;
				}
			}
		 private bool bool_ChoPhepBinhLuan ;
		 public bool ChoPhepBinhLuan
			{
			 get 	
				{
					 return this.bool_ChoPhepBinhLuan;
				}
			 set 	
				{
					bool_ChoPhepBinhLuan=value;
				}
			}
		 private int int_LuotXem ;
		 public int LuotXem
			{
			 get 	
				{
					 return this.int_LuotXem;
				}
			 set 	
				{
					int_LuotXem=value;
				}
			}
		 private bool bool_TrangThai ;
		 public bool TrangThai
			{
			 get 	
				{
					 return this.bool_TrangThai;
				}
			 set 	
				{
					bool_TrangThai=value;
				}
			}
		 private bool bool_Tinnong ;
		 public bool Tinnong
			{
			 get 	
				{
					 return this.bool_Tinnong;
				}
			 set 	
				{
					bool_Tinnong=value;
				}
			}
#endregion

		/// <summary>
		/// Inserts a record into the TinTuc table.
		/// <summary>
		/// <param name="IdTinTuc"></param>
		/// <param name="IdMenu"></param>
		/// <param name="TenDangNhap"></param>
		/// <param name="TieuDe"></param>
		/// <param name="TomTat"></param>
		/// <param name="NoiDung"></param>
		/// <param name="NgayTao"></param>
		/// <param name="NgayDang"></param>
		/// <param name="HinhAnh"></param>
		/// <param name="TuKhoa"></param>
		/// <param name="Tag"></param>
		/// <param name="NguonTin"></param>
		/// <param name="TinNoiBat"></param>
		/// <param name="ChoPhepBinhLuan"></param>
		/// <param name="LuotXem"></param>
		/// <param name="TrangThai"></param>
		/// <param name="Tinnong"></param>
		/// <returns></returns>
		public bool Insert(SqlConnection SqlCnn)
		{
			bool boolInsert = false ;
			TinTuc_DA clsDA_TinTuc = new TinTuc_DA();
			clsDA_TinTuc.IdTinTuc=int_IdTinTuc;
			clsDA_TinTuc.IdMenu=int_IdMenu;
			clsDA_TinTuc.TenDangNhap=string_TenDangNhap;
			clsDA_TinTuc.TieuDe=string_TieuDe;
			clsDA_TinTuc.TomTat=string_TomTat;
			clsDA_TinTuc.NoiDung=string_NoiDung;
			clsDA_TinTuc.NgayTao=DateTime_NgayTao;
			clsDA_TinTuc.NgayDang=DateTime_NgayDang;
			clsDA_TinTuc.HinhAnh=string_HinhAnh;
			clsDA_TinTuc.TuKhoa=string_TuKhoa;
			clsDA_TinTuc.Tag=string_Tag;
			clsDA_TinTuc.NguonTin=string_NguonTin;
			clsDA_TinTuc.TinNoiBat=bool_TinNoiBat;
			clsDA_TinTuc.ChoPhepBinhLuan=bool_ChoPhepBinhLuan;
			clsDA_TinTuc.LuotXem=int_LuotXem;
			clsDA_TinTuc.TrangThai=bool_TrangThai;
			clsDA_TinTuc.Tinnong=bool_Tinnong;

            boolInsert = clsDA_TinTuc.Insert(SqlCnn);
			clsDA_TinTuc = null ;
			return boolInsert;
		}

		/// <summary>
		/// Selects a single record from the TinTuc table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable Select(SqlConnection SqlCnn)
		{
			TinTuc_DA clsDA_TinTuc = new TinTuc_DA();
			DataTable dt = new DataTable();
            dt = clsDA_TinTuc.Select(SqlCnn);
			clsDA_TinTuc= null ;
			return dt;
		}

		/// <summary>
		/// Selects a single record from the TinTuc table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable SelectPrimaryKey(SqlConnection SqlCnn)
		{
			TinTuc_DA clsDA_TinTuc = new TinTuc_DA();
			DataTable dt = new DataTable();
			clsDA_TinTuc.IdTinTuc=int_IdTinTuc;

			dt=clsDA_TinTuc.SelectPrimaryKey(SqlCnn);
			clsDA_TinTuc= null;
			return dt;
			}

		/// <summary>
		/// Updates a record in the TinTuc table.
		/// <summary>
		/// <param name="IdTinTuc"></param>
		/// <param name="IdMenu"></param>
		/// <param name="TenDangNhap"></param>
		/// <param name="TieuDe"></param>
		/// <param name="TomTat"></param>
		/// <param name="NoiDung"></param>
		/// <param name="NgayTao"></param>
		/// <param name="NgayDang"></param>
		/// <param name="HinhAnh"></param>
		/// <param name="TuKhoa"></param>
		/// <param name="Tag"></param>
		/// <param name="NguonTin"></param>
		/// <param name="TinNoiBat"></param>
		/// <param name="ChoPhepBinhLuan"></param>
		/// <param name="LuotXem"></param>
		/// <param name="TrangThai"></param>
		/// <param name="Tinnong"></param>
		public bool Update(SqlConnection SqlCnn)
		{
			bool boolUpdate = false ;
			TinTuc_DA clsDA_TinTuc = new TinTuc_DA();
			clsDA_TinTuc.IdTinTuc=int_IdTinTuc;
			clsDA_TinTuc.IdMenu=int_IdMenu;
			clsDA_TinTuc.TenDangNhap=string_TenDangNhap;
			clsDA_TinTuc.TieuDe=string_TieuDe;
			clsDA_TinTuc.TomTat=string_TomTat;
			clsDA_TinTuc.NoiDung=string_NoiDung;
			clsDA_TinTuc.NgayTao=DateTime_NgayTao;
			clsDA_TinTuc.NgayDang=DateTime_NgayDang;
			clsDA_TinTuc.HinhAnh=string_HinhAnh;
			clsDA_TinTuc.TuKhoa=string_TuKhoa;
			clsDA_TinTuc.Tag=string_Tag;
			clsDA_TinTuc.NguonTin=string_NguonTin;
			clsDA_TinTuc.TinNoiBat=bool_TinNoiBat;
			clsDA_TinTuc.ChoPhepBinhLuan=bool_ChoPhepBinhLuan;
			clsDA_TinTuc.LuotXem=int_LuotXem;
			clsDA_TinTuc.TrangThai=bool_TrangThai;
			clsDA_TinTuc.Tinnong=bool_Tinnong;

			boolUpdate = clsDA_TinTuc.Update(SqlCnn);
			clsDA_TinTuc = null ;
			return boolUpdate;
		}

		/// <summary>
		/// Deletes a record from the TinTuc table by a composite primary key.
		/// <summary>
		public bool Delete(SqlConnection SqlCnn)
		{
			bool boolDelete = false ;
			TinTuc_DA clsDA_TinTuc = new TinTuc_DA();
			clsDA_TinTuc.IdTinTuc=int_IdTinTuc;

			boolDelete = clsDA_TinTuc.Delete(SqlCnn);
			clsDA_TinTuc = null ;
			return boolDelete;
		}
	}

